#include <cstdio>
#include <cstring>
#include <cstdint>
#include "../mem/mem_init.h"
#include "../fpga/fpga_regs_macro.h"
#include "../../platform/include/platform.hpp"
#include "clock_init.h"

void axi_clock_check(FPGA_TYPE type){//TODO: AXI 总线时钟 检测

    switch (type) {
        case Zynq7000:
        case ZynqMP:
            default:
            printp("Error Fpga Type, Please check Fpga Type\n");
            return;
    }

    uint32_t fpga_clock_t;
    mem_read<uint32_t>(AXI_CLOCK_LTE_REG,fpga_clock_t);

     if(fpga_clock_t !=  AXI_CLOCK_LTE_200M_CLOCK) {
         mem_write<uint32_t>(AXI_CLOCK_LTE_REG,AXI_CLOCK_LTE_200M_CLOCK); //设置AXI总线的时钟
     }else{
         return;
     }
}
